//引入封装好的接口
import {roleList} from '../../../request/api'
const state = {
    rolelist:[]
}
const getters = {
    getRole(state){
        return state.rolelist
    }
}

const mutations = {
    REQ_LIST(state,payload){
        state.rolelist = payload
    }
}

const actions = {
    getRoleAction({commit}){
        roleList()
        .then(res=>{
            // console.log(res,'行动');
            if(res.code==200){
                //提交mutations
                commit('REQ_LIST',res.list)
            }
        })
        
    }
}

export default {
    state,
    getters,
    actions,
    mutations,
    namespaced:true
}